<?php
class Wee_Logging_Block_Adminhtml_Details_Grid extends Mage_Adminhtml_Block_Widget_Grid{
    protected function _construct(){
        $this -> setId('loggingDetailsGrid');
        $this -> setPagerVisibility(false);
        $this -> setFilterVisibility(false);
    }
    protected function _prepareCollection(){
        $event = Mage :: registry('current_event');
        $collection = Mage :: getResourceModel('wee_logging/event_changes_collection') -> addFieldToFilter('event_id', $event -> getId());
        $this -> setCollection($collection);
        return parent :: _prepareCollection();
    }
    protected function _prepareColumns(){
        $this -> addColumn('source_name', array('header' => Mage :: helper('wee_logging') -> __('Source Data'), 'sortable' => false, 'renderer' => 'wee_logging/adminhtml_details_renderer_sourcename', 'index' => 'source_name', 'width' => 1));
        $this -> addColumn('original_data', array('header' => Mage :: helper('wee_logging') -> __('Value Before Change'), 'sortable' => false, 'renderer' => 'wee_logging/adminhtml_details_renderer_diff', 'index' => 'original_data'));
        $this -> addColumn('result_data', array('header' => Mage :: helper('wee_logging') -> __('Value After Change'), 'sortable' => false, 'renderer' => 'wee_logging/adminhtml_details_renderer_diff', 'index' => 'result_data'));
        return parent :: _prepareColumns();
    }
}